class Solution 
{
public:
    int waysToStep(int n) 
    {
        int MOD = 1000000007;
        if(n == 1 || n==0 || n==2  )  return n;
        if(n==3) return 4;
        int a =1 ,b = 2,c = 4,d;
        for(int i = 4;i <= n;i++)
        {
            d = ((a+b)%MOD+c)%MOD;
            a = b;
            b = c;
            c = d;
        }
        return d;
    }
};
